package fiuba.algo3.controlador;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import fiuba.algo3.juego.JuegoGPS;



public class ControladorFlechitas implements KeyListener {
			private JuegoGPS modelo;
		    
			public ControladorFlechitas(JuegoGPS modelo) {
				this.modelo=modelo;
		    }

			@Override
			public void keyPressed(KeyEvent e) {
				System.out.println(e.getKeyText(e.getKeyCode())); //ver tecla presionada
				
				String l=e.getKeyText(e.getKeyCode());
				
				if (l.equals("Arriba")){
					modelo.moverVehiculoArriba();
				}
		
				if (l.equals("Abajo")){
					modelo.moverVehiculoAbajo();
				}
		
				if (l.equals("Izquierda")){
					modelo.moverVehiculoIzquierda();
				}
		
				if (l.equals("Derecha")){
					modelo.moverVehiculoDerecha();
				}
		}

			@Override
			public void keyReleased(KeyEvent e) {
			}

			@Override
			public void keyTyped(KeyEvent e) {
			}

	
}